<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="https://www.baidu.com">百度一下</a>
    <br>
    <hr>

    <form action="ZZC.java">
        <input type="submit" value="登录">
    </form>

    <script>
        let aEle = document.querySelector('a');
        aEle.addEventListener('click',function(event){
            event.preventDefault();     //阻止标签的默认行为
            alert('弹弹弹!!!')
        });
    </script>
</body>
</html>